package com.wangbo.multi.exception;

import lombok.Data;

/**
 * @Package: com.company.scaffold.exception
 * @Author: Mr.Waves
 * @Date: 2020-03-08 17:52
 * @Description: 自定义异常类
 **/
@Data
public class CustomException extends RuntimeException {
    private Integer code;
    private String message;
    private BaseExceptionEnum exceptionEnum;

    public CustomException(BaseExceptionEnum baseExceptionEnum) {
        this.code = baseExceptionEnum.getCode();
        this.message = baseExceptionEnum.getMessage();
        this.exceptionEnum = baseExceptionEnum;
    }

    public CustomException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
